From: Keir Fraser Date: Fri, 16 Oct 2009 07:30:13 +0000 (+0100) Subject: xend: passthrough: do not check non-page-aligned MMIO BAR if not strict-check X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~13217 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https:/%22bookmarks://%22Dat/%22http:/www.example.com/cgi/%22https:/%22bookmarks:/%22Dat?a=commitdiff_plain;h=6edd9aaf782b201534d278f943de23734134d9f6;p=xen.git xend: passthrough: do not check non-page-aligned MMIO BAR if not strict-check When the option pci-passthrough-strict-check of /etc/xen/xend-config.sxp is set to 'no', we don't check the non-page-aligned MMIO BAR. This could be useful in some cases, e.g., when there is only 1 device in the range of the page and we try to assign the device to pv guest. Signed-off-by: Dexuan Cui --- diff --git a/tools/python/xen/xend/XendDomainInfo.py b/tools/python/xen/xend/XendDomainInfo.py index 724c50951e..d4fd6bffb8 100644 --- a/tools/python/xen/xend/XendDomainInfo.py +++ b/tools/python/xen/xend/XendDomainInfo.py @@ -702,8 +702,9 @@ class XendDomainInfo: raise VmError(("pci: PCI Backend and pci-stub don't own device %s")\ %pci_device.name) + strict_check = xoptions.get_pci_dev_assign_strict_check() # Check non-page-aligned MMIO BAR. - if pci_device.has_non_page_aligned_bar and arch.type != "ia64": + if pci_device.has_non_page_aligned_bar and strict_check: raise VmError("pci: %s: non-page-aligned MMIO BAR found." % \ pci_device.name) @@ -711,7 +712,7 @@ class XendDomainInfo: if not self.info.is_hvm(): return - if not xoptions.get_pci_dev_assign_strict_check(): + if not strict_check: return # Check if there is intermediate PCIe switch bewteen the device and diff --git a/tools/python/xen/xend/server/pciif.py b/tools/python/xen/xend/server/pciif.py index 3d1f7b27c3..3d544110d6 100644 --- a/tools/python/xen/xend/server/pciif.py +++ b/tools/python/xen/xend/server/pciif.py @@ -289,9 +289,6 @@ class PciController(DevController): raise VmError(("pci: PCI Backend and pci-stub don't own "+ \ "device %s\n") %(dev.name)) - if dev.has_non_page_aligned_bar and arch.type != "ia64": - raise VmError("pci: %s: non-page-aligned MMIO BAR found." % dev.name) - self.CheckSiblingDevices(fe_domid, dev) # We don't do FLR when we create domain and hotplug device into guest, @@ -368,6 +365,9 @@ class PciController(DevController): raise VmError("pci: failed to locate device and "+ "parse its resources - "+str(e)) + if dev.has_non_page_aligned_bar and strict_check: + raise VmError("pci: %s: non-page-aligned MMIO BAR found." % dev.name) + # Check if there is intermediate PCIe switch bewteen the device and # Root Complex. if self.vm.info.is_hvm() and dev.is_behind_switch_lacking_acs() \